<?php  
session_start();
// 检测是否登陆
if(isset($_SESSION['admin_id'])){
    header("Location: ./index.php");
}
?>
<!DOCTYPE html>
<html>
  <head>
        <meta charset="UTF-8">
        <title>ThinkSite-Shop | 后台登陆</title>
        <!-- Tell the browser to be responsive to screen width -->
        <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
        <!-- Bootstrap 3.3.4 -->
        <link href="./skin/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <!-- Theme style -->
        <link href="./skin/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
        <!-- iCheck -->
        <link href="./skin/css/blue.css" rel="stylesheet" type="text/css" />
        <style>#imgVerify{width: 120px;margin: 0 auto; text-align: center;display: block;}</style>
    </head>
    <body class="login-page">
        <div class="login-box">
            <div class="login-logo">
                <a href="#">
                    <b>ThinkSite-Shop</b>
                </a>
            </div>
            <div class="login-box-body">
                <form action="admin.php" method="post" id="admin-login">
                    <input type="hidden" name="act" value="dologin">
                    <p class="login-box-msg">管理后台</p>
                    <div class="form-group has-feedback">
                        <input type="text" name="username" id="username" class="form-control" placeholder="账号" />
                        <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
                    </div>
                    <div class="form-group has-feedback">
                        <input type="password" name="password" class="form-control" id="password" placeholder="密码" />
                        <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-primary btn-block btn-flat" >立即登陆</button>
                    </div>
                </form>
            </div>
            <div class="margin text-center">
                <div class="copyright">2014-<?php echo date("Y");?> &copy;
                    <a href="http://www.thinskite.cn">thinksiteshop v1.0.0</a>
                    <br/>
                    <a href="http://www.thinskite.cn">欣才互联网学院</a>出品
                </div>
            </div>
        </div>
        <script type="text/javascript" src="./skin/js/common.js"></script>
        <script>
            $('admin-login').onsubmit = function(){
                var msg = "";
                var username = $('username').value;
                var password = $('password').value;
                if(username == '' || password == ''){
                    msg += '请填写用户名和密码!\n';
                }
                if (msg == '') {
                    return true;
                } else {
                    alert(msg);
                    return false;
                }
            }
        </script>
    </body>
</html>